package com.todo.event.activity.infrastructure.mapper;

import com.todo.event.activity.infrastructure.entity.condition.EventDecisionCondition;
import com.todo.event.activity.infrastructure.entity.po.EventDecisionPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author azhebuxing
 * @date 2025/1/6 19:33
 * @description
 */
@Mapper
public interface EventDecisionMapper {

    int insertEventDecisionPO(EventDecisionPO eventDecision);

    int updateEventDecisionPOById(EventDecisionPO eventDecision);

    int removeEventDecisionPOById(@Param("id") Long id);

    EventDecisionPO queryEventDecisionPOById(@Param("id") Long id);

    Long queryCountByCondition(EventDecisionCondition eventDecisionCondition);

    List<EventDecisionPO> queryEventDecisionListByCondition(EventDecisionCondition eventDecisionCondition);

    int updateEventDecisionStatus(@Param("id") Long id,@Param("oldStatus")  Integer oldStatus, @Param("newStatus") Integer newStatus);

    EventDecisionPO queryEventDecisionByName(@Param("name") String name);

    List<EventDecisionPO> queryFirstDecisionByEventCode(@Param("eventCode") String eventCode,@Param("status") Integer status);
    List<EventDecisionPO> querySecondDecisionByEventCode(@Param("eventCode") String eventCode,@Param("status") Integer status);

}
